﻿using System.Collections.Generic;

namespace HamcoWcs.Models.Common
{

    public abstract class CascaderBase<T> where T : class, new()
    {
        public List<T> Children { get; set; }
    }

    public class LocationCascaderDto : CascaderDto<LocationCascaderDto>
    {
        public int Id { get; set; }
        public int LocStatus { get; set; }
        //public bool MyProperty { get; set; }

        public LocationCascaderDto(string value, string label, List<LocationCascaderDto> children = null)
        {
            Value = value;
            try
            {
                Id = int.Parse(value);
            }
            catch (System.Exception)
            {
                Id = 0;
            }
            Label = label;
            Children = children;
        }

        public LocationCascaderDto()
        {
        }
    }


    public class CascaderDto<T> : CascaderBase<T> where T : class, new()
    {
        public string Value { get; set; }
        public string Label { get; set; }
    }

    public class CascaderDto : CascaderDto<CascaderDto>
    {
        public CascaderDto()
        {

        }

        public CascaderDto(string value, string label, List<CascaderDto> children = null)
        {
            Value = value;
            Label = label;
            Children = children;
        }
    }


}
